<div class="chapter_item_item" id="chapter_item_item_{$chapterItem['id']}" style="width:100%;margin:20px 0; position: relative">

    <input type="hidden" class="form-control chapter_item_id" name="chapter_item_id_{$chapter['id']}[]" value="{$chapterItem['id']}">

    <input type="hidden" class="form-control chapter_item_show" name="chapter_item_show_{$chapter['id']}[]" value="{$chapterItem['is_trysee']}">
    <input type="hidden" class="form-control chapter_item_status" name="chapter_item_status_{$chapter['id']}[]" value="{$chapterItem['status']}">
    <input type="hidden" class="form-control chapter_item_isrecommand" name="chapter_item_isrecommand_{$chapter['id']}[]" value="{$chapterItem['isrecommand']}">
    <!--    <input type="hidden" class="form-control chapter_item_ispublic" name="chapter_item_ispublic_{$chapter['id']}[]" value="{$chapterItem['is_public']}">-->
    <!--    <input type="hidden" class="form-control chapter_item_ispublic_show" name="chapter_item_ispublic_show_{$chapter['id']}[]" value="{$chapterItem['is_public_show']}">-->

    <div class="input-group">
        <span class="input-group-addon">ID:{$chapterItem['id']}</span>
        <span class="input-group-addon" style="width: 70px;overflow: hidden;">
            <label class="checkbox-inline" style="margin-top: -4px;margin-right: 0;">
                <input type="checkbox" {if $chapterItem['status']==1}checked{/if} value="1" onclick='statusItem(this)'>上架
            </label>
        </span>
        <!-- <span class="input-group-addon" style="width: 70px;overflow: hidden;">
            <label class="checkbox-inline" style="margin-top: -4px;margin-right: 0;">
                <input type="checkbox" {if $chapterItem['isrecommand']==1}checked{/if} value="1" onclick='isrecommandItem(this)'>推荐
            </label>
        </span> -->
        <span class="input-group-addon" style="width: 70px;overflow: hidden;">
            <label class="checkbox-inline" style="margin-top: -4px;margin-right: 0;">
                <input type="checkbox" {if $chapterItem['is_trysee']==1}checked{/if} value="1" onclick='showItem(this)'>免费课
            </label>
        </span>
        <!--        <span class="input-group-addon" style="width: 70px;overflow: hidden;">-->
        <!--            <label class="checkbox-inline" style="margin-top: -4px;margin-right: 0;">-->
        <!--                <input type="checkbox" {if $chapterItem['is_public']==1}checked{/if} value="1" onclick='setPublic(this)'>体验课-->
        <!--            </label>-->
        <!--        </span>-->
        <!--        <span class="input-group-addon" style="width: 70px;overflow: hidden;">-->
        <!--            <label class="checkbox-inline" style="margin-top: -4px;margin-right: 0;">-->
        <!--                <input type="checkbox" {if $chapterItem['is_public_show']==1}checked{/if} value="1" onclick='setPublicShow(this)'>公开课显示-->
        <!--            </label>-->
        <!--        </span>-->
        <span class="input-group-addon" style="width: 90px;background: #ddd;">
            <input type="text" id="displayorder_val_{$chapterItem['id']}" name="displayorder_val_{$chapter['id']}[]" value="{$chapterItem['displayorder_val']}" placeholder="第{$numbers[$chapterItem['displayorder']]}节" style="width: 100%;background: #ddd;" readonly ondblclick="this.readOnly=false" onchange="this.readOnly=true">
        </span>

        <input style="height: 32px" type="text" id="chapter_item_video_name_{$chapterItem['id']}" class="form-control chapter_item_title valid" name="chapter_item_title_{$chapter['id']}[]" value="{$chapterItem['title']}" placeholder="章节标题">

        <span class="input-group-addon" style="width: 80px">
            <input type="text" name="chapter_item_price_{$chapter['id']}[]" value="{$chapterItem['unit_price']}" placeholder="0.00" style="width: 100%">
        </span>
        <span class="input-group-addon">
            元
        </span>

        <span class="input-group-addon" style="width: 80px">
            <input type="text" id="chapter_item_video_duration_time_{$chapterItem['id']}" name="chapter_item_video_duration_time_{$chapter['id']}[]" value="{$chapterItem['video_duration_time']}" onblur="updateDuration(this)" placeholder="时长" style="width: 100%">
        </span>
        <span class="input-group-addon" style="width: 80px;display: none;">
            <input type="text" id="chapter_item_video_size_{$chapterItem['id']}" name="chapter_item_video_size_{$chapter['id']}[]" value="{$chapterItem['video_duration']}" placeholder="秒" style="width: 100%">
        </span>
        <span class="input-group-addon" style="width: 80px;display: none;">
            <input type="text" id="chapter_item_video_duration_{$chapterItem['id']}" name="chapter_item_video_duration_{$chapter['id']}[]" value="{$chapterItem['video_duration']}" placeholder="秒" style="width: 100%">
        </span>

        <span class="input-group-addon ajax-model btn-default pointer" id="chapter_item_isupload_{$chapterItem['id']}" onclick="ajaxModel(this)" data-url="{:webUrl('web.goods.upload/index',array('chapter_item_id' => $chapterItem['id'],'goodsid'=>$id,'chapter_id'=>$chapter['id'],'displayorder'=>$chapterItem['displayorder'],'is_update' => 0))}" data-toggle="tooltip" data-placement="top" title="上传新视频">
            上传
        </span>

        {if !empty($chapterItem['video_url'])}
<!--        <span class="input-group-addon ajax-model btn-default pointer" id="chapter_item_isupload_up_{$chapterItem['id']}" onclick="ajaxModel(this)" data-url="{:webUrl('web.goods.upload/index',array('chapter_item_id' => $chapterItem['id'],'goodsid'=>$id,'chapter_id'=>$chapter['id'],'displayorder'=>$chapterItem['displayorder'],'is_update' => 1 ))}" data-toggle="tooltip" data-placement="top" title="更新视频(原有基础替换)">-->
<!--            更新-->
<!--        </span>-->
        {/if}

        <span class="input-group-addon pointer" onclick="removeChapterItem(this)" data-toggle="tooltip" data-placement="top" data-original-title="删除">
            <i class="icon icon-trash"></i>
        </span>
        <span class="input-group-addon pointer" onclick="upChapterItem(this)" data-toggle="tooltip" data-placement="top" data-original-title="上移">
            <i class="icon icon-long-arrow-up"></i>
        </span>
        <span class="input-group-addon pointer" onclick="downChapterItem(this)" data-toggle="tooltip" data-placement="top" data-original-title="下移">
            <i class="icon icon-long-arrow-down"></i>
        </span>
    </div>

    <div class="input-group img-item">
        <div class="input-group-addon">
            {if empty($chapterItem['thumb'])}
            <img src="/app/admin/static/images/default-pic.jpg" style="max-height:26px;width:50px">
            {else}
            <img src="{:tomedia($chapterItem['thumb'])}?x-oss-process=image/resize,h_52,w_100/format,webp" style="max-height:26px;width:50px"/>
            {/if}
        </div>
        <input type="text" class="form-control" name="chapter_item_video_thumb_{$chapter['id']}[]" value="{$chapterItem['thumb']}"/>
        <div class="input-group-btn">
            <button type="button" class="btn btn-default btn-select-pic">选择图片</button>
        </div>
    </div>

    <!-- 测试视频 -->
    <!-- http://yf.ugc.v.cztv.com/cztv/ugcvod/2018/04/14/A98CD7B26B06D94A5CEA56AA7D723572/h264_800k_mp4.mp4_playlist.m3u8 -->

    <!-- // 视频时长 秒 -->
    <!-- <input type="hidden" id="chapter_item_video_duration_{$chapterItem['id']}" name="chapter_item_video_duration_{$chapter['id']}[]" value="{$chapterItem['video_duration']}"> -->
    <!-- // 视频时长 时:分:秒 -->
    <!-- <input type="hidden" id="chapter_item_video_duration_time_{$chapterItem['id']}" name="chapter_item_video_duration_time_{$chapter['id']}[]" value="{$chapterItem['video_duration_time']}"> -->

    <!-- // 视频名称 -->
    <input type="hidden" id="chapter_item_video_filename_{$chapterItem['id']}" name="chapter_item_video_filename_{$chapter['id']}[]">

    <!-- // 队列id -->
    <input type="hidden" id="chapter_item_queueid_{$chapterItem['id']}" name="chapter_item_queueid_{$chapter['id']}[]" value="">

    <div class="input-group">
        <span class="input-group-addon">视频地址</span>
        <input type="text" class="form-control chapter_item_video valid" readonly ondblclick="this.readOnly=false" onchange="this.readOnly=true" id="chapter_item_video_url_{$chapterItem['id']}" name="chapter_item_video_url_{$chapter['id']}[]" value="{$chapterItem['video_url']}" aria-invalid="false" placeholder="视频地址">
    </div>

    <!--    <div class="input-group">-->
    <!--        <span class="input-group-addon">-->
    <!--            （540p）视频地址-->
    <!--        </span>-->
    <!--        <input type="text" class="form-control chapter_item_video valid" readonly ondblclick="this.readOnly=false" onchange="this.readOnly=true" id="chapter_item_video_480_url_{$chapterItem['id']}" name="chapter_item_video_480_url_{$chapter['id']}[]" value="{$chapterItem['video_480_url']}" aria-invalid="false" placeholder="540p视频地址">-->
    <!--    </div>-->

    <!--    <div class="input-group">-->
    <!--        <span class="input-group-addon">-->
    <!--            （720p）视频地址-->
    <!--        </span>-->
    <!--        <input type="text" class="form-control chapter_item_video valid" readonly ondblclick="this.readOnly=false" onchange="this.readOnly=true" id="chapter_item_video_720_url_{$chapterItem['id']}" name="chapter_item_video_720_url_{$chapter['id']}[]" value="{$chapterItem['video_720_url']}" aria-invalid="false" placeholder="720p视频地址">-->
    <!--    </div>-->

    <!--    <div class="input-group">-->
    <!--        <span class="input-group-addon">-->
    <!--            （1080p）视频地址-->
    <!--        </span>-->
    <!--        <input type="text" class="form-control chapter_item_video valid" readonly ondblclick="this.readOnly=false" onchange="this.readOnly=true" id="chapter_item_video_1080_url_{$chapterItem['id']}" name="chapter_item_video_1080_url_{$chapter['id']}[]" value="{$chapterItem['video_1080_url']}" aria-invalid="false" placeholder="1080p视频地址">-->
    <!--    </div>-->

</div>


<!--<script>-->
<!--    require(['jquery', 'util'], function ($, util) {-->
<!--        $('.btn-select-pic').unbind('click').click(function () {-->
<!--            var imgitem = $(this).closest('.img-item');-->
<!--            util.image('', function (data) {-->
<!--                imgitem.find('img').attr('src', data['url']);-->
<!--                imgitem.find('input').val(data['fileurl']);-->
<!--            });-->
<!--        });-->
<!--    });-->
<!--</script>-->